Adds GitOps Toolkit EventRecorder to ArtifactGenerator reconciler#310
Adds GitOps Toolkit EventRecorder to ArtifactGenerator reconciler#310renatovassaomb wants to merge 1 commit intofluxcd:mainfrom
Conversation
Signed-off-by: Renato Vassão <renato.vassao@mindbodyonline.com>
|
Hi @renatovassaomb! Thanks for this PR 🙏 If you use your other account @renatovassao you will be able to use the CI without us allowing it to run. Also, I think we discussed in the dev meeting, this PR should not simply replace the current event recorder with the notification-controller one because the events that are currently sent are too much, it will be a lot of noise. We need to selectively send events to notification-controller for the most important ones, e.g. errors (make them aggregated i.e. do not send one error per source or per artifact), and an event when an artifact digest changes (should also be a single event for all artifacts whose digest changed). |
Sounds good, thanks for the insights @matheuscscp. I wanted to get this open to make sure I was on the right track, I'll keep working on it to meet these requirements. |
| EventRecorder: mgr.GetEventRecorderFor(controllerName), | ||
| EventRecorder: eventRecorder, |
There was a problem hiding this comment.
potentially here on the ArtifactGeneratorReconciler{}, we could have an additional NotificationEventRecorder.
This would give us granularity within the Reconcile to decide which events are intentionally desirable for notification-controller vs. internal controller usage for status
wdyt @stefanprodan ?
cc @matheuscscp
There was a problem hiding this comment.
No need for this, we can set the events we don't want to reach NC to trace. See https://github.com/fluxcd/pkg/blob/40ae93e513e71a2398a487990bff1108b1ececab/runtime/events/recorder.go#L204
Summary
Adding GitOps Toolkit EventRecorder to ArtifactGenerator Reconciler.
This will make generated events to be forwarded to the specified events address, which usually is the notifications controller.
Fixes #307.
Testing
kind create cluster docker build -t fluxcd/source-watcher:latest . kind load docker-image fluxcd/source-watcher:latestflux install --components="notification-controller"--events-addrflag in source-watcher Deployment and deploy it